package jjn.kamacoder.case16;

import java.util.Scanner;

/**
 * @author Jjn
 * @since 2023-08-31 11:20
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int total = scanner.nextInt();
            scanner.nextLine();
            for (int i = 0; i < total; i++) {
                String input = scanner.nextLine();
                char[] charArray = input.toCharArray();
                int first = 0, second = 1;
                while (second < charArray.length) {
                    char temp = charArray[first];
                    charArray[first] = charArray[second];
                    charArray[second] = temp;
                    first += 2;
                    second += 2;
                }
                System.out.println(new String(charArray));
            }
        }
    }
}
